<?
	require_once("../cBasic/950cons.php");
	$reqid=$_GET['reqid'];
	$empid=$_GET['empid'];
	$skillid=$_GET['skillid'];
	$salary=$_GET['salary'];


	$emps=explode('|',$empid);
	$skills=explode('|',$skillid);
	$payment=explode('|',$salary);

	for ($i=0;$i<count($emps);$i++){
		$sQuery= "INSERT INTO contract (ReqID, Payment, EmpID, SkillID) value ('".$reqid."','".$payment[$i]."','".$emps[$i]."','".$skills[$i]."')";
		mysql_query( $sQuery, $con ) or die(mysql_error());
	}
	$sQuery= "UPDATE request SET ProcessStep = 'Done' where ReqID = '".$reqid."'";
	mysql_query( $sQuery, $con ) or die(mysql_error());
	
	mysql_close($con);
?>